<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>首页</title>
    <meta name="keywords" content="关键字">
    <meta name="description" content="描述">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

     <link href="${ctx}/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css" rel="stylesheet">
</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element text-center">
                            <span><img alt="image" class="img-circle" style ="border-radius:0px;width:100%;" src="${ctx }/img/logo_1_1.png" width="64px" /></span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs"><strong class="font-bold"></strong></span>
                                <span class="text-muted text-xs block">${adminView.username }<b class="caret"></b></span>
                                </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a class="J_menuItem" id="modifica_password">修改密码</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="${ctx}/login">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">520印刷</div>
                    </li>
                    
<!--                     <li> -->
<%--                         <a class="J_menuItem" id = "mainPage" href="${ctx}/suggestion/toSuggestion"> --%>
<!--                             <i class="fa fa-home"></i> -->
<!--                             <span class="nav-label">主页</span> -->
<!--                         </a> -->
<!--                     </li> -->
                    <li>
                        <a class="J_menuItem" id = "mainPage" href="${ctx}/giftManage/listGift">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">商品管理</span>
                        </a>
                    </li>
                     <li>
                        <a class="J_menuItem" id = "mainPage11" href="${ctx}/img/toImgManagerPage">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">首页轮播</span>
                        </a>
                    </li>
 					
 					<li ><a ><i class="fa fa-star-o" ></i>
						<span class="nav-label">订单管理</span><span class="fa arrow"></span></a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp">所有订单</a></li>
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp?0">未支付订单</a></li>
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp?1">待发货订单</a></li>
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp?4">待收货订单</a></li>
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp?2">待评价订单</a></li>
						<li><a class="J_menuItem" href="${ctx}/page/order.jsp?3">已完成订单</a></li>
					</ul>
					</li>
				    <li>
                        <a class="J_menuItem" id = "mainPage11" href="${ctx}/page/comment.jsp">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">评论审核</span>
                        </a>
                    </li>
                      <li>
                        <a class="J_menuItem" id = "mainPage11" href="${ctx}/page/user.jsp">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">查询用户信息</span>
                        </a>
                    </li>
                     <li>
                        <a class="J_menuItem" id = "mainPage11" href="${ctx}/user/daili">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">添加代理商</span>
                        </a>
                    </li>
					
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                    </div>
                  
                </nav>
            </div>
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" data-id="${ctx}/giftManage/listGift">商品管理</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
                </button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
                    </button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                        </li>
                        <li class="divider"></li>
                        <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                        </li>
                    </ul>
                </div>
                <a href="${ctx}/login" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${ctx}/giftManage/listGift" frameborder="0" data-id="${ctx}/giftManage/listGift" seamless></iframe>
            </div>
            <div class="footer">
                <div class="pull-right">Copyright 2016 普恒网络科技有限责任公司
                </div>
            </div>
        </div>
        <!--右侧部分结束-->
        <!--右侧边栏开始-->

        <!--右侧边栏结束-->


    <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctx}/js/metisMenu/jquery.metisMenu.js"></script>
    <script src="${ctx}/js/slimscroll/jquery.slimscroll.min.js"></script>
     <script type="text/javascript" src="${ctx}/js/md5.js"></script>
    <script type="text/javascript" src="${ctx}/js/validate/jquery.validate.min.js" ></script>
	<script src="${ctx}/js/layer/layer.min.js"></script>
	<script src="${ctx}/js/sweetalert/sweetalert.min.js"></script>
    <!-- 自定义js -->
    <script src="${ctx}/js/hplus.js"></script>
    <script type="text/javascript" src="${ctx}/js/contabs.js"></script>

    <!-- 第三方插件 -->
    <script src="${ctx}/js/pace/pace.min.js"></script>
    
	<!-- 自定义js -->
	<script src="${ctx}/js/content.js?v=1.0.0"></script>
	

    
    
    <script>
        $('#modifica_password').on('click', function(){
           layer.open({
                type: 1,
                title: '修改密码',
                area: ['500px', '320px'],
                shadeClose: true, //点击遮罩关闭
                content:'<div class="ibox-content form-horizontal"><form id="updPwd">\
                    <div class="form-group">\
                        <label class="col-sm-4 control-label"><span class="text-danger">*</span>原密码：</label>\
                        <div class="col-sm-5">\
                            <input class="form-control" type="password" name="oldPwd" id="oldPwd">\
                        </div>\
                    </div>\
                    <div class="form-group">\
                        <label class="col-sm-4 control-label"><span class="text-danger">*</span>新密码：</label>\
                        <div class="col-sm-5">\
                            <input class="form-control" type="password" name="newPwd" id="newPwd">\
                        </div>\
                    </div>\
                    <div class="form-group">\
                    <label class="col-sm-4 control-label"><span class="text-danger">*</span>确认密码：</label>\
                    <div class="col-sm-5">\
                        <input class="form-control" type="password" name="rePwd">\
                    </div>\
                </div>\
                    <div class="form-group">\
                        <div class="col-sm-5 col-sm-offset-4">\
                            <button class="btn btn-primary layui-layer-close " type="button" onclick="updPwd()">&#8195;保存&#8195;</button><!--layui-layer-close关闭弹出框-->\
                        </div>\
                    </div></form>\
                </div>'
            });
           initValid();
        });

	function updPwd(){
		var oldPwd = hex_md5($("#oldPwd").val());
		var newPwd = hex_md5($("#newPwd").val());
		if($("#updPwd").valid()){
			$.ajax({
				type : "POST",
				url : "updPwd",
				data : {
					"oldPwd" : oldPwd,
					"newPwd" : newPwd
				},
				dataType : "json",
				error:function(){
					swal("网络连接错误","", "error");
				},
				success : function(data) {
					alert(data.msg);
					if(data.status == true){
						window.location.href = "${ctx}/login";
					}
				}
			})
		}
	}
		
	function initValid(){
		$("#updPwd").validate({
			debug : false,
			rules : {
				oldPwd : {
					required : true,
					minlength : 6
				},
				newPwd : {
					required : true,
					minlength : 6
				},
				rePwd:{
					required : true,
					minlength : 6,
					equalTo:"#newPwd"
				},
			},
			messages : {
				oldPwd : {
					required : "请填写原密码",
					minlength : "密码最小为6位"
				},
				newPwd : {
					required : "请填写新密码",
					minlength : "密码最小为6位"
				},
				rePwd : {
					required : "必须填写验证码",
					minlength : "密码最小为6位",
					equalTo:"两次密码输入不一致"
				}
			}
		});
	}
    </script>
    </body>
</html>
